/*
 *	bsd_socket.h
 */

#ifndef __BSD_SOCKET_H__
#define __BSD_SOCKET_H__

/*
 * Definitions related to sockets: types, address families, options.
 */

/*
 * Option flags per-socket.
 */
#define	BSD_SO_DEBUG	0x0001		/* turn on debugging info recording */
#define	BSD_SO_ACCEPTCONN	0x0002		/* socket has had listen() */
#define	BSD_SO_REUSEADDR	0x0004		/* allow local address reuse */
#define	BSD_SO_KEEPALIVE	0x0008		/* keep connections alive */
#define	BSD_SO_DONTROUTE	0x0010		/* just use interface addresses */
#define	BSD_SO_BROADCAST	0x0020		/* permit sending of broadcast msgs */
#define	BSD_SO_USELOOPBACK	0x0040		/* bypass hardware when possible */
#define	BSD_SO_LINGER	0x0080		/* linger on close if data present */
#define	BSD_SO_OOBINLINE	0x0100		/* leave received OOB data in line */

/*
 * Additional options, not kept in BSD_SO_options.
 */
#define BSD_SO_SNDBUF	0x1001		/* send buffer size */
#define BSD_SO_RCVBUF	0x1002		/* receive buffer size */
#define BSD_SO_SNDLOWAT	0x1003		/* send low-water mark */
#define BSD_SO_RCVLOWAT	0x1004		/* receive low-water mark */
#define BSD_SO_SNDTIMEO	0x1005		/* send timeout */
#define BSD_SO_RCVTIMEO	0x1006		/* receive timeout */
#define	BSD_SO_ERROR	0x1007		/* get error status and clear */
#define	BSD_SO_TYPE		0x1008		/* get socket type */

/*
 * Level number for (get/set)sockopt() to apply to socket itself.
 */
#define	BSD_SOL_SOCKET	0xffff		/* options for socket level */

#endif /* __BSD_SOCKET_H__ */

